import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/home',
    name: 'Home',
    component: Home
  },
  //公厕查询
  {
    path: '/test',// /test
    name: 'Test',
    component: () => import('../views/lavatory/index.vue')
  },
  {
    path: '/test_detail',
    name: 'test_detail',
    component: () => import('../views/lavatory/detail.vue')
  },
  {
    path: '/map',
    name: 'map',
    component: () => import('../views/lavatory/map.vue')
  },
  //公交路线查询
  {
    path: '/bus',// /bus
    name: 'bus',
    component: () => import('../views/bus/index.vue')
  },
  {
    path: '/bus_detail',
    name: 'bus_detail',
    component: () => import('../views/bus/detail.vue')
  },
  //社会流动人员档案查询
  {
    path: '/population',// /population
    name: 'population',
    component: () => import('../views/population/index.vue')
  },
  {
    path: '/population_detail',
    name: 'population_detail',
    component: () => import('../views/population/detail.vue')
  },
  //汽车维修经营许可证查询
  {
    path: '/',// /car
    name: 'car',
    component: () => import('../views/car/index.vue')
  },
  {
    path: '/car_detail',
    name: 'car_detail',
    component: () => import('../views/car/detail.vue')
  },
  // {
  //   path: '/about',
  //   name: 'About',
  //   // route level code-splitting
  //   // this generates a separate chunk (about.[hash].js) for this route
  //   // which is lazy-loaded when the route is visited.
  //   component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
  // }
]

const router = new VueRouter({
  mode: 'hash',
  base: process.env.BASE_URL,
  routes
})

export default router
